﻿<%@ Page Language="C#" MasterPageFile="~/YUIAspNet.Master" AutoEventWireup="true" CodeBehind="LoadingDialog.aspx.cs" Inherits="YUIAspNetDemo.SimpleDialog.LoadingPage" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>YUIAspNet Controls : LiveDemo : SimpleDialog : Loading</title>
    <script type="text/javascript">
        
        /*
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        
        beginRequest Event
Raised before processing of an asynchronous postback starts and the postback request is sent to the server.
endRequest Event
Raised after an asynchronous postback is finished and control has been returned to the browser.
        */
    
        function pageLoad (sender, args)
        {
            var prm = Sys.WebForms.PageRequestManager.getInstance();
            
            prm.add_beginRequest(function() { $find('<%=dlg.ClientID %>').show(); })
            //prm.add_endRequest(function() {$find('<%=dlg.ClientID %>').hide(); })
        }
        
    </script>
    
    <style type="text/css">
        .ft, .hd, .yui-icon {display:none} /*hide the icon and the footer*/
        
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h1>Loading dialog using SimpleDialog</h1>
    
    <p>The button below will do an ajax post, to get the current time. On the server, I simulate a heavy operation using Thread.Sleep.</p>
    <asp:ScriptManagerProxy ID="proxy" runat="server"></asp:ScriptManagerProxy>
    
    <asp:UpdatePanel ID="pnlUpdate" runat="server">
        <ContentTemplate>
            <p><yui:Button ID="btnPost" runat="server" Text="Click me to get the time."></yui:Button></p>
            
            <p><asp:Label ID="lbl" runat="server" Text="time not set."></asp:Label></p>
        </ContentTemplate>
    </asp:UpdatePanel>
    
    <yui:SimpleDialog ID="dlg" runat="server" Centered="true" Modal="true" Width="70px">
        <TextTemplate>
            <img src="/App_Themes/Default/loading.gif" alt="Loading" />
        </TextTemplate>
    </yui:SimpleDialog>
</asp:Content>
